import Loading from '@/components/lib/loading/Loading.vue';
import { h, render } from 'vue';
export const loading = () => {
  // 组件关闭时的回调
  const duration = () => {
    //3、 删除组件
    render(null, document.body);
  };
  //1、拿到VNode
  const VNode = h(Loading, { duration });
  //2、render VNode
  render(VNode, document.body);
  const show = () => VNode.component?.exposed?.open;
  const close = () => VNode.component?.exposed?.close;
  return {
    show,
    close,
    duration,
  };
};
